home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Programming / AmigaTalk / System / Timer.st < prev   
Text File  |  2000-05-08  |  1KB  |  59 lines

  1. "----------------------------------------------------------------------"
  2. " TimerDevice Class is derived from abstract Device Class.             "
  3. ""
  4. "  WARNING:  You should know what you're doing to the Amiga OS before  "
  5. "            messing with this Class, or any other System Class!       "
  6. " ---------------------------------------------------------------------"
  7.  
  8. Class TimerDevice :Device
  9. ! tname seconds micros timerType !
  10. [
  11.    stop
  12.       <primitive 228 2 tname> "Kill Timer (you still have to close it)."
  13. |
  14.    startWithSecs: s withMicros: m
  15.       <primitive 228 3 tname s m>
  16. |
  17.    delaySeconds: s micros: m
  18.       <primitive 228 4 tname s m>
  19. |
  20.    test
  21.       ^ <primitive 228 5 tname>
  22. |
  23.    setTimerType: newType
  24.       timerType <- newType
  25. |
  26.    getTimerType
  27.       ^ timerType
  28. |
  29.    getSeconds
  30.       ^ <primitive 228 6 tname>
  31. |
  32.    getMicros
  33.       ^ <primitive 228 7 tname> 
  34. |
  35.    setSeconds: s micros: m
  36.       seconds <- s.
  37.       micros  <- m.
  38.       ^ <primitive 228 8 tname s m>
  39. |
  40.    compare: s micros: m toSeconds: s2 micros: m2
  41.       ^ <primitive 228 9 tname s m s2 m2>
  42. |
  43.    getEClockHigh
  44.       ^ <primitive 228 10 tname>
  45. |
  46.    getEClockLow
  47.       ^ <primitive 228 11 tname>
  48. |
  49.    new: newTimerName
  50.       tname <- newTimerName.
  51.       ^ self
  52. |
  53.    openTimerType
  54.       <primitive 228 1 tname timerType seconds micros> "Setup Timer."
  55. |
  56.    close
  57.       <primitive 228 0 tname> "Close the Timer."
  58.